#ifndef TOKEN_H
#define TOKEN_H

#include <stdlib.h>

// used by token class
enum TokenType {
	NONE,
	SKIP,

	// Types which go into hash table
	IDENTIFIER,

	// reserved words
	RESERVED_WORD,
	INT_TYPE,
	IF_TYPE,
	ELSE_TYPE,
	WHILE_TYPE,
	READ_TYPE,
	PRINT_TYPE,

	INTEGER,
	COMMENT,

	// Types without information
	SIGN, // TODO: make State use SIGN_* instead
	SIGN_PLUS,
	SIGN_MINUS,
	SIGN_DIV,
	SIGN_MULTI,

	SIGN_SMALLER,
	SIGN_GREATER,
	SIGN_EQUAL,

	SIGN_ASSIGN,

	SIGN_NOT,
	SIGN_AND,

	SIGN_SEMICOLON,

	SIGN_OPENPAREN,
	SIGN_CLOSEPAREN,
	SIGN_OPENBRACKET,
	SIGN_CLOSEBRACKET,
	SIGN_OPENBRACE,
	SIGN_CLOSEBRACE,

	// Automate error token
	ERROR,
	END_OF_FILE
};

#include "Information.h"

class Token {
public:
	Token(TokenType newType = NONE, size_t newLine = 0, size_t newColumn = 0, void* newInfo = 0);
	virtual ~Token();

	void setInformation(void* newInfo);
	void setType(TokenType newType);
	void setLine(size_t newLine); // set the line (starts with 1)
	void setColumn(size_t newColumn) ;

	void* getInformation();
	TokenType getType();
	size_t getLine();
	size_t getColumn() ;
	char* getLexem();
	int getValue() ;

private:
	TokenType type;
	size_t line;
	size_t column;
	void* information;

	void cleanup();
};

#endif
